﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SharingCenter.Web.Mod.Groups.Manage
{
    using SharingCenter.Web.Classes;
    using SharingCenter.Web.Classes.Groups;

    public partial class Default : GroupsPageBase
    {
        protected void Page_Init(object sender, EventArgs e)
        {
            ParseGroupIdFromQueryString();
            IsAdminOrRedirect(member);
            HasRights(groupId, Profile.UserId);
            FormView1.ItemUpdated += new FormViewUpdatedEventHandler(FormView1_ItemUpdated);
            //FormView1.ItemUpdating += new FormViewUpdateEventHandler(FormView1_ItemUpdating);
        }

        //void FormView1_ItemUpdating(object sender, FormViewUpdateEventArgs e)
        //{
            
        //}

        void FormView1_ItemUpdated(object sender, FormViewUpdatedEventArgs e)
        {
            if (e.Exception == null)
            {
                ModuleChanges.ModuleChange("Group");
                SetTopMostMessage("圈子信息已更新。", true);
                RefreshPage();
            }
            else
            {
                SetTopMostMessage("服务器错误，请重试。", true);
            }
        }
    }
}
